package ui
{
	import flash.display.*;
	import mx.core.*;
	
	public class kline extends FlexSprite
	{
		private var __width:Number = 0;
		private var __height:Number = 0;
		private static var __rColor:Number = 0xFF0000;
		private static var __gColor:Number = 0x00FF00;
		public function kline()
		{
			super();
		}

		public function get _width():Number
		{
			return __width;
		}

		public function set _width(value:Number):void
		{
			__width = value;
		}

		public function get _height():Number
		{
			return __height;
		}

		public function set _height(value:Number):void
		{
			__height = value;
		}
		public function show(w:Number=0,h:Number=0,is_red:Boolean = true):void
		{
			if(w!=0){
				_width = w;
			}
			if(h!=0){
				_height = h;
			}
			var _color:Number = 0;
			if(is_red){
				_color = __rColor;
			}else{
				_color = __gColor;
			}
			this.doDrawRect(w,h,_color);
		}
		private function doDrawRect(w:Number ,h:Number,bgColor:Number):void {
			var child:Shape = new Shape();
			child.graphics.beginFill(bgColor);
			child.graphics.drawRect(0, 0, w, h);
			child.graphics.endFill();
			this.addChild(child);
		}
	}
}